package com.jgp;

import com.jgp.sys.utils.SpringContextUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

@Configuration
@Import(SpringContextUtil.class)
@SpringBootApplication(scanBasePackages = {"com.jgp.**.config"})
public class SysApplication extends SpringBootServletInitializer {
    
    public static void main(String[] args) {
        SpringApplication.run(SysApplication.class, args);
    }
    
    @PostConstruct
    void started() {
        TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
    }
    
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SysApplication.class);
    }
    
   
    
}
